package com.dcy;

import com.dcy.dao.StudentDao;
import com.dcy.domain.Student;
import com.dcy.utils.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.ArrayList;
import java.util.List;
//测试foreache标签，以JAVABean实体类List集合作为形参
public class Starter04 {
    public static void main(String[] args) {
        SqlSession sqlSession = MyBatisUtil.getSqlSession();
        StudentDao studentDao = sqlSession.getMapper(StudentDao.class);
        List<Student> studentList=new ArrayList<>();
        Student student=new Student();
        student.setId(1001);
        student.setEmail("haha@qq.com");
        student.setName("还行吧");
        student.setAge(22);
        studentList.add(student);
        List<Student> students = studentDao.selectForeachTwo(studentList);
        System.out.println(students);
    }
}
